{template 'header'}
<style>
    .lists_title{
        font-size: 16px;
        padding-left: 15px;
        line-height: 1.5;
        color: #333;
    }
    .lists{
        font-size: 14px;
    }
    .lists input{
        font-size: 14px;
    }
    .mui-btn-block{
        margin: 15px auto;
        padding: 11px 0;
        width: 96%;
        font-size: 14px;
    }
</style>
</head>
<body>
<div class="mui-content">
    <div class="lists" id="input_example">
        <h4 class="lists_title">请填写基本信息</h4>
        <div class="mui-input-group">
            <div class="mui-input-row">
                <label>会员电话：</label>
                <input type="text" class="mui-input-clear" placeholder="" value="{$user['mobile']}" readonly="readonly">
            </div>
            <div class="mui-input-row">
                <label>真实姓名：</label>
                <input type="text" class="mui-input-clear" placeholder="请输入真实姓名" value="{$user['truename']}"
                       id="truename">
            </div>
            <div class="mui-input-row">
                <label>身份证号：</label>
                <input type="number" class="mui-input-clear" placeholder="请输入身份证号" value="{$user['idno']}" id="idno">
            </div>
        </div>
        <h4 class="lists_title">请填写支付信息</h4>
        <div class="mui-input-group">
            <div class="mui-input-row">
                <label>支付宝账号：</label>
                <input type="number" class="mui-input-clear" placeholder="请输入支付宝账号" value="{$user['alipay_account']}"
                       id="alipay_account">
            </div>
            <div class="mui-input-row">
                <label>支付宝姓名：</label>
                <input type="text" class="mui-input-clear" placeholder="请输入支付宝姓名" value="{$user['alipay_name']}"
                       id="alipay_name">
            </div>
            <div class="mui-input-row">
                <label>银行卡号：</label>
                <input type="number" class="mui-input-clear" placeholder="请输入银行卡号" value="{$user['bank_card']}"
                       id="bank_card">
            </div>
            <div class="mui-input-row">
                <label>银行卡姓名：</label>
                <input type="text" class="mui-input-clear" placeholder="请输入银行卡姓名" value="{$user['bank_truename']}"
                       id="bank_truename">
            </div>
            <div class="mui-input-row">
                <label>开户行：</label>
                <input type="text" class="mui-input-clear" placeholder="请输入开户行" value="{$user['bank_branch']}"
                       id="bank_branch">
            </div>
        </div>
    </div>
    <button type="button" class="mui-btn mui-btn-primary mui-btn-block" onclick="tijiao()">确认</button>
</div>
<script src="{MODULE_URL}assets/js/mui.min.js"></script>
<script src="{MODULE_URL}assets/js/jquery.min.js"></script>
<script type="text/javascript">
    mui.init({})
    mui.ready(function () {

    })
    function tijiao() {
        var truename = $('#truename').val();
        var idno = $('#idno').val();
        var alipay_account = $('#alipay_account').val();
        var alipay_name = $('#alipay_name').val();
        var bank_card = $('#bank_card').val();
        var bank_truename = $('#bank_truename').val();
        var bank_branch = $('#bank_branch').val();
        if(!truename || !idno || !alipay_account || !alipay_name || !bank_card || !bank_card || !bank_truename || !bank_branch){
            mui.toast('请完善信息');return;
        }
        var list_url = '{php echo $this->createMobileUrl("core",array("op"=>"wanshan"))}';
        mui.ajax(list_url, {
            data: {truename, idno, alipay_account, alipay_name, bank_card, bank_truename, bank_branch},
            dataType: 'json',//服务器返回json格式数据
            type: 'post',//HTTP请求类型
            async: false,
            timeout: 10000,//超时时间设置为10秒；
            success: function (ret) {
                if (ret.code) {
                    mui.alert(ret.msg, '', function () {
                        location.href = '{php echo $this->createMobileUrl("member",array("op"=>"index"))}'
                    });
                } else {
                    mui.toast(ret.msg)
                }
            },
            error: function (xhr, type, errorThrown) {
                //异常处理；
                mui.alert(errorThrown);
            }
        });
    }
</script>
</body>

</html>